﻿namespace EyeOpen.UI.Silverlight
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    /// <summary>
    /// Converts the logged in or logout state to content of the button.If the state is logged in,the content of the button 
    /// is logout, if the state of the user is logout,the content of the button is login.
    /// </summary>
    public class BoolToContentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var isLoggedIn = (bool)value;
            if (isLoggedIn)
            {
                return "Logout";
            }

            return "Login";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
